home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / cpcug.zip / PUSHDIR.DOC < prev    next >
Text File  |  1987-04-20  |  3KB  |  57 lines

  1.           PUSHDIR (and POPDIR)                       John Friend
  2.           Commands
  3.           Copyright (c) 1986, Ziff-Davis Publishing Co.
  4.           ______________________________________________________
  5.  
  6.           Purpose:  Provides a way to return automatically to
  7.                     your current directory after running programs
  8.                     that require directory changing.
  9.  
  10.           Format:   PUSHDIR
  11.                     [CD \AltDir\ProgName]
  12.                     POPDIR
  13.  
  14.           Remarks:  While PUSHDIR and POPDIR can be entered
  15.                     directly from the DOS prompt, their primary
  16.                     application is in batch files.  For example,
  17.                     suppose you create a file named 12.BAT that
  18.                     consists of the following four lines:
  19.  
  20.                          PUSHDIR
  21.                          CD\LOTUS
  22.                          123
  23.                          POPDIR
  24.  
  25.                     Suppose also that 12.BAT, PUSHDIR.COM, and
  26.                     POPDIR.COM are either in your root directory
  27.                     or in a subdirectory on the PATH specified in
  28.                     your AUTOEXEC.BAT file.  Assume, finally,
  29.                     that you are currently in your word
  30.                     processing subdirectory (\WP), but need some
  31.                     information from a 1-2-3 spreadsheet.  If you
  32.                     now enter
  33.  
  34.                          12<CR>
  35.  
  36.                     from the DOS prompt, PUSHDIR stores the \WP
  37.                     (your current directory) on its stack and DOS
  38.                     changes to the \LOTUS subdirectory and runs
  39.                     1-2-3.  When you exit from 1-2-3, you would
  40.                     normally be left in the \LOTUS subdirectory.
  41.                     A DOS CD command in 12.BAT after the 123 line
  42.                     could return you to a specified directory
  43.                     every time you terminated 1-2-3, of course.
  44.                     But POPDIR returns you to whatever
  45.                     subdirectory you were in when you invoked 1-
  46.                     2-3--in this case, to your \WP subdirectory.
  47.  
  48.                     PUSHDIR can accommodate up to six levels of
  49.                     directories on its stack, permitting
  50.                     considerable programming flexibility in
  51.                     constructing batch files.
  52.  
  53.                     Notes:
  54.  
  55.                     1.   PUSHDIR and POPDIR require DOS 2.0 or
  56.                          later.
  57.